using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace DTO
{
	/// <summary> 
	///Author: nnamthach@gmail.com 
	/// <summary>
	
    public class LOAICHUNGTUInfo
    {
		#region Local Variable
		public enum Field
		{
			LOAICT,
			TENCT
		}
		private String _LOAICT;
		private String _TENCT;
		
		public String LOAICT{	get{ return _LOAICT;} set{_LOAICT = value;} }
		public String TENCT{	get{ return _TENCT;} set{_TENCT = value;} }
		
        #endregion LocalVariable
        
        #region Constructor
		public LOAICHUNGTUInfo()
		{
			_LOAICT = "";
			_TENCT = "";
		}
		public LOAICHUNGTUInfo(
		String LOAICT,
		String TENCT
		)
		{
			_LOAICT = LOAICT;
			_TENCT = TENCT;
		}
		public LOAICHUNGTUInfo(DataRow dr)
		{
			if (dr != null)
			{
				_LOAICT = dr[Field.LOAICT.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.LOAICT.ToString()]);
				_TENCT = dr[Field.TENCT.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.TENCT.ToString()]);
			}
		}
		public LOAICHUNGTUInfo(DataRowView dr)
		{
			if (dr != null)
			{
				_LOAICT = dr[Field.LOAICT.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.LOAICT.ToString()]);
				_TENCT = dr[Field.TENCT.ToString()] == DBNull.Value?"":Convert.ToString(dr[Field.TENCT.ToString()]);
			}
		}
		public LOAICHUNGTUInfo(LOAICHUNGTUInfo objEntr)
		{			
			_LOAICT = objEntr.LOAICT;			
			_TENCT = objEntr.TENCT;			
		}
        #endregion Constructor
        
        #region InitTable
		public static DataTable ToDataTable()
		{
			DataTable dt = new DataTable("LOAICHUNGTU");
			dt.Columns.AddRange(new DataColumn[] { 
				new DataColumn(Field.LOAICT.ToString(), typeof(String)),
				new DataColumn(Field.TENCT.ToString(), typeof(String))
			});
			return dt;
		}
		public DataRow ToDataRow(DataTable dt)
		{
			DataRow row = dt.NewRow();
			row[Field.LOAICT.ToString()] = _LOAICT;
			row[Field.TENCT.ToString()] = _TENCT;
			return row;
		}
        #endregion InitTable
    }
}
